package com.yejing.httpdemo;

import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;
import cn.hutool.http.HttpUtil;

public class HutHttp {
    public static void main(String[] args) {
        String url = "https://10.16.115.29:13900/edge/manager/device/writeDataToDevice";
        String param = "{\"propertyCode\":\"START000001\",\"propertyValue\":\"111\",\"time\":1686900315408,\"deviceCode\":\"A2202020122200001\"}";
        HttpRequest postReq = HttpUtil.createPost(url);
        postReq.header("Content-Type", "application/json");
        postReq.header("APPID", "b3690816d91b471f9198c7fca908619a");
        postReq.header("APPSECRET", "5b5b1754c7c24630a5029211851d30cb");
        postReq.body(param);
        HttpResponse response = postReq.execute();
        System.out.println(response.body());
    }
}
